package com.ruoyi.fs.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.fs.mapper.FsCaseRepaymentScheduleMapper;
import com.ruoyi.fs.domain.FsCaseRepaymentSchedule;
import com.ruoyi.fs.service.IFsCaseRepaymentScheduleService;

/**
 * 还款计划Service业务层处理
 * 
 * @author hero
 * @date 2024-11-11
 */
@Service
public class FsCaseRepaymentScheduleServiceImpl implements IFsCaseRepaymentScheduleService 
{
    @Autowired
    private FsCaseRepaymentScheduleMapper fsCaseRepaymentScheduleMapper;

    /**
     * 查询还款计划
     * 
     * @param id 还款计划主键
     * @return 还款计划
     */
    @Override
    public FsCaseRepaymentSchedule selectFsCaseRepaymentScheduleById(Long id)
    {
        return fsCaseRepaymentScheduleMapper.selectFsCaseRepaymentScheduleById(id);
    }

    /**
     * 查询还款计划列表
     * 
     * @param fsCaseRepaymentSchedule 还款计划
     * @return 还款计划
     */
    @Override
    public List<FsCaseRepaymentSchedule> selectFsCaseRepaymentScheduleList(FsCaseRepaymentSchedule fsCaseRepaymentSchedule)
    {
        return fsCaseRepaymentScheduleMapper.selectFsCaseRepaymentScheduleList(fsCaseRepaymentSchedule);
    }

    /**
     * 新增还款计划
     * 
     * @param fsCaseRepaymentSchedule 还款计划
     * @return 结果
     */
    @Override
    public int insertFsCaseRepaymentSchedule(FsCaseRepaymentSchedule fsCaseRepaymentSchedule)
    {
        fsCaseRepaymentSchedule.setCreateTime(DateUtils.getNowDate());
        return fsCaseRepaymentScheduleMapper.insertFsCaseRepaymentSchedule(fsCaseRepaymentSchedule);
    }

    /**
     * 修改还款计划
     * 
     * @param fsCaseRepaymentSchedule 还款计划
     * @return 结果
     */
    @Override
    public int updateFsCaseRepaymentSchedule(FsCaseRepaymentSchedule fsCaseRepaymentSchedule)
    {
        fsCaseRepaymentSchedule.setUpdateTime(DateUtils.getNowDate());
        return fsCaseRepaymentScheduleMapper.updateFsCaseRepaymentSchedule(fsCaseRepaymentSchedule);
    }

    /**
     * 批量删除还款计划
     * 
     * @param ids 需要删除的还款计划主键
     * @return 结果
     */
    @Override
    public int deleteFsCaseRepaymentScheduleByIds(Long[] ids)
    {
        return fsCaseRepaymentScheduleMapper.deleteFsCaseRepaymentScheduleByIds(ids);
    }

    /**
     * 删除还款计划信息
     * 
     * @param id 还款计划主键
     * @return 结果
     */
    @Override
    public int deleteFsCaseRepaymentScheduleById(Long id)
    {
        return fsCaseRepaymentScheduleMapper.deleteFsCaseRepaymentScheduleById(id);
    }
}
